FROM mysql:9.1.1
#ADD https://ghp.ci/https://raw.githubusercontent.com/alibaba/nacos/refs/heads/develop/distribution/conf/mysql-schema.sql /docker-entrypoint-initdb.d/nacos-mysql.sql
COPY ./mysql/8/nacos-schema.sql /docker-entrypoint-initdb.d/nacos-mysql.sql
RUN chown -R mysql:mysql /docker-entrypoint-initdb.d/nacos-mysql.sql
ENV MYSQL_DATABASE=nacos_config
ENV MYSQL_USER=nacos
ENV MYSQL_PASSWORD=nacos
ENV MYSQL_ROOT_PASSWORD=root
EXPOSE 3306
CMD ["mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"]